﻿using GalaSoft.MvvmLight.Messaging;
using Microsoft.Phone.Controls;
namespace Tfs.OnTheRoad.ViewModel
{
    /// <summary>
    /// Base ViewModel
    /// </summary>
    public class BaseViewModel : GalaSoft.MvvmLight.ViewModelBase
    {
        public BaseViewModel():base()
        {
            Messenger.Default.Register<PhoneApplicationPage>(this, "SaveState", false, (page) => SaveState(page));
            Messenger.Default.Register<PhoneApplicationPage>(this, "RestoreState", false, (page) => RestoreState(page));
        }

        public virtual void Refresh()
        {            
        }

        protected virtual void RestoreState(PhoneApplicationPage page)
        {
        }

        protected virtual void SaveState(PhoneApplicationPage page)
        {
        }


        private string _pageTitle;

        public string PageTitle
        {
            get { return _pageTitle; }
            set
            {
                _pageTitle = value;
                RaisePropertyChanged("PageTitle");
            }
        }

    }
}
